#!/bin/bash
# /etc/init.d/usbauto
#

#This will mount usb drive after boot up and umount before shutdown

case "$1" in
  start)
    echo "Mounting Drives"
        echo "/dev/disk/by-id/ata-Hitachi_HDP725032GLA380_GEK033RG2WZUWC-part2	swap	swap	defaults	0	0" > /etc/fstab
        echo "UUID=ca43824d-0dda-4c36-a9c1-c552821e6f5f	/	btrfs	defaults	0	0" >> /etc/fstab
        echo "UUID=1c71079b-1675-4792-b57a-88965aff36bf	/Data	btrfs	defaults	0	0" >> /ect/fastab
	echo "UUID=968CB2AA8CB28471	/MacMedia	ntfs	defaults,umask=007,gid=46	0	0" >> /etc/fstab
	echo "UUID=781A323E1A31F9A8	/MacMovies	ntfs	defaults,umask=007,gid=46	0	0" >> /etc/fstab
	echo "UUID=7414588E145854E8	/MacTVShow	ntfs	defaults,umask=007,gid=46	0	0" >> /etc/fstab
	echo "UUID=385C60845C603EAE	/MacWD	ntfs	defaults,umask=007,gid=46	0	0" >> /etc/fstab
	/bin/mount -a
    ;;
  stop)
    echo "Unmounting Drives"
	echo "/dev/disk/by-id/ata-Hitachi_HDP725032GLA380_GEK033RG2WZUWC-part2	swap	swap	defaults	0	0" > /etc/fstab
        echo "UUID=ca43824d-0dda-4c36-a9c1-c552821e6f5f	/	btrfs	defaults	0	0" >> /etc/fstab
        echo "UUID=1c71079b-1675-4792-b57a-88965aff36bf	/Data	btrfs	defaults	0	0" >> /ect/fastab	
	/bin/umount /Mac*
    ;;
  *)
    echo "Usage: /etc/init.d/usbauto {start|stop}"
    exit 1
    ;;
esac

exit 0





